using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Forms;


namespace NCS_CS.My
{
	class MyProject
	{
		
		[ThreadStatic] static MyForms forms;
		
		public static MyForms Forms {
			[DebuggerStepThrough]
			get {
				if (forms == null)
					forms = new MyForms();
				return forms;
			}
		}
		
		internal sealed class MyForms
		{
			global::NCS_CS.FormShixu FormShixu_instance;
			bool FormShixu_isCreating;
			public global::NCS_CS.FormShixu FormShixu {
				[DebuggerStepThrough] get { return GetForm(ref FormShixu_instance, ref FormShixu_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref FormShixu_instance, value); }
			}
			
			global::NCS_CS.frmSelectChanel frmSelectChanel_instance;
			bool frmSelectChanel_isCreating;
			public global::NCS_CS.frmSelectChanel frmSelectChanel {
				[DebuggerStepThrough] get { return GetForm(ref frmSelectChanel_instance, ref frmSelectChanel_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmSelectChanel_instance, value); }
			}
			
			global::NCS_CS.frmAbout frmAbout_instance;
			bool frmAbout_isCreating;
			public global::NCS_CS.frmAbout frmAbout {
				[DebuggerStepThrough] get { return GetForm(ref frmAbout_instance, ref frmAbout_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmAbout_instance, value); }
			}
			
			global::NCS_CS.frmchanel frmchanel_instance;
			bool frmchanel_isCreating;
			public global::NCS_CS.frmchanel frmchanel {
				[DebuggerStepThrough] get { return GetForm(ref frmchanel_instance, ref frmchanel_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmchanel_instance, value); }
			}
			
			global::NCS_CS.frmChanels frmChanels_instance;
			bool frmChanels_isCreating;
			public global::NCS_CS.frmChanels frmChanels {
				[DebuggerStepThrough] get { return GetForm(ref frmChanels_instance, ref frmChanels_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmChanels_instance, value); }
			}
			
			global::NCS_CS.frmLine frmLine_instance;
			bool frmLine_isCreating;
			public global::NCS_CS.frmLine frmLine {
				[DebuggerStepThrough] get { return GetForm(ref frmLine_instance, ref frmLine_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmLine_instance, value); }
			}
			
			global::NCS_CS.FrmLoadmethod FrmLoadmethod_instance;
			bool FrmLoadmethod_isCreating;
			public global::NCS_CS.FrmLoadmethod FrmLoadmethod {
				[DebuggerStepThrough] get { return GetForm(ref FrmLoadmethod_instance, ref FrmLoadmethod_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref FrmLoadmethod_instance, value); }
			}
			
			global::NCS_CS.frmLogin frmLogin_instance;
			bool frmLogin_isCreating;
			public global::NCS_CS.frmLogin frmLogin {
				[DebuggerStepThrough] get { return GetForm(ref frmLogin_instance, ref frmLogin_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmLogin_instance, value); }
			}
			
			global::NCS_CS.frmChangePWD frmChangePWD_instance;
			bool frmChangePWD_isCreating;
			public global::NCS_CS.frmChangePWD frmChangePWD {
				[DebuggerStepThrough] get { return GetForm(ref frmChangePWD_instance, ref frmChangePWD_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmChangePWD_instance, value); }
			}
			
			global::NCS_CS.frmInputPWD frmLogin2_instance;
			bool frmLogin2_isCreating;
			public global::NCS_CS.frmInputPWD frmLogin2 {
				[DebuggerStepThrough] get { return GetForm(ref frmLogin2_instance, ref frmLogin2_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmLogin2_instance, value); }
			}
			
			global::NCS_CS.frmMain frmMain_instance;
			bool frmMain_isCreating;
			public global::NCS_CS.frmMain frmMain {
				[DebuggerStepThrough] get { return GetForm(ref frmMain_instance, ref frmMain_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmMain_instance, value); }
			}
			
			global::NCS_CS.FrmMethod FrmMethod_instance;
			bool FrmMethod_isCreating;
			public global::NCS_CS.FrmMethod FrmMethod {
				[DebuggerStepThrough] get { return GetForm(ref FrmMethod_instance, ref FrmMethod_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref FrmMethod_instance, value); }
			}
			
			global::NCS_CS.FrmOpenSample FrmOpenSample_instance;
			bool FrmOpenSample_isCreating;
			public global::NCS_CS.FrmOpenSample FrmOpenSample {
				[DebuggerStepThrough] get { return GetForm(ref FrmOpenSample_instance, ref FrmOpenSample_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref FrmOpenSample_instance, value); }
			}
			
			global::NCS_CS.frmResult frmResult_instance;
			bool frmResult_isCreating;
			public global::NCS_CS.frmResult frmResult {
				[DebuggerStepThrough] get { return GetForm(ref frmResult_instance, ref frmResult_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmResult_instance, value); }
			}
			
			global::NCS_CS.frmSetTp frmSetTp_instance;
			bool frmSetTp_isCreating;
			public global::NCS_CS.frmSetTp frmSetTp {
				[DebuggerStepThrough] get { return GetForm(ref frmSetTp_instance, ref frmSetTp_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmSetTp_instance, value); }
			}
			
			global::NCS_CS.FrmStandard FrmStandard_instance;
			bool FrmStandard_isCreating;
			public global::NCS_CS.FrmStandard FrmStandard {
				[DebuggerStepThrough] get { return GetForm(ref FrmStandard_instance, ref FrmStandard_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref FrmStandard_instance, value); }
			}
			
			global::NCS_CS.frmTiaoling frmTiaoling_instance;
			bool frmTiaoling_isCreating;
			public global::NCS_CS.frmTiaoling frmTiaoling {
				[DebuggerStepThrough] get { return GetForm(ref frmTiaoling_instance, ref frmTiaoling_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmTiaoling_instance, value); }
			}
			
			global::NCS_CS.frmUser frmUser_instance;
			bool frmUser_isCreating;
			public global::NCS_CS.frmUser frmUser {
				[DebuggerStepThrough] get { return GetForm(ref frmUser_instance, ref frmUser_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmUser_instance, value); }
			}
            global::NCS_CS.FormTestCurve FormTestCurve_instance;
            bool FormTestCurve_isCreating;
            public global::NCS_CS.FormTestCurve FormTestCurve
            {
                [DebuggerStepThrough]
                get { return GetForm(ref FormTestCurve_instance, ref FormTestCurve_isCreating); }
                [DebuggerStepThrough]
                set { SetForm(ref FormTestCurve_instance, value); }
            }
			global::NCS_CS.frmWeight frmWeight_instance;
			bool frmWeight_isCreating;
			public global::NCS_CS.frmWeight frmWeight {
				[DebuggerStepThrough] get { return GetForm(ref frmWeight_instance, ref frmWeight_isCreating); }
				[DebuggerStepThrough] set { SetForm(ref frmWeight_instance, value); }
			}
			
			[DebuggerStepThrough]
			static T GetForm<T>(ref T instance, ref bool isCreating) where T : Form, new()
			{
				if (instance == null || instance.IsDisposed) {
					if (isCreating) {
						throw new InvalidOperationException("WinForms_RecursiveFormCreate", null);
					}
					isCreating = true;
					try {
						instance = new T();
					} catch (System.Reflection.TargetInvocationException ex) {
						throw new InvalidOperationException("WinForms_SeeInnerException",  ex.InnerException);
					} finally {
						isCreating = false;
					}
				}
				return instance;
			}
			
			[DebuggerStepThrough]
			static void SetForm<T>(ref T instance, T value) where T : Form
			{
				if (instance != value) {
					if (value == null) {
						instance.Dispose();
						instance = null;
					} else {
						throw new ArgumentException("Property can only be set to null");
					}
				}
			}
		}
	}

    class MyMain
	{
		[STAThread]
		public static void Main(string[] args)
		{
           
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ModMain.beginProgram();
            modLog.savelogmsg("init path:" + modLog.initpath);
            ModMain.gscope.SetVariable("frmMain", My.MyProject.Forms.frmMain);

            Application.Run(My.MyProject.Forms.frmMain);
            
            //Application.Run(My.MyProject.Forms.FormTestCurve);
            //MainForm m = new MainForm();
            //Application.Run(m);
		}
	}
	

}
